<?php
/**
 * 
 * Template for showing invitations and sending them
 * 
 * @category Abovo
 * 
 * @package Abovo_App_System
 * 
 * @subpackage Abovo_App_System_Users
 * 
 * @license http://opensource.org/licenses/gpl-license.php GPL
 * 
 * @author Antti Holvikari <anttih@gmail.com>
 * 
 */
?>
<div class="yui-gc">
<div class="yui-u first">
    <h2><?php echo $this->getText('TEXT_INVITATIONS') ?></h2>
    <table class="list">
        <tr>
            <th><?php echo $this->getText('LABEL_EMAIL') ?></th>
            <th><?php echo $this->getText('LABEL_CREATED') ?></th>
            <th><?php echo $this->getText('LABEL_HANDLE') ?></th>
            <th><?php echo $this->getText('TEXT_STATUS') ?></th>
        </tr>
    <?php foreach ($this->invitations as $invitation): ?>
        <tr>
            <td><?php echo $invitation->email ?></td>
            <td><?php echo $this->timestamp($invitation->created, $this->getText('FORMAT_DATE')) ?></td>
            <td><?php echo $invitation->handle ?></td>
            <td><?php echo ($invitation->status == Abovo_Model_Invites::STATUS_APPROVED) 
                ? $this->getText('TEXT_APPROVED') : $this->getText('TEXT_PENDING') ?></td>
        </tr>
    <?php endforeach; ?>
    </table>
</div>
<div class="yui-u">
    <h2>Send new invitation</h2>
    <?php echo $this->form()
                    ->addElement($this->invite_form->elements['email'])
                    ->addElement($this->invite_form->elements['message'])
                    ->addElement(array(
                        'type'  => 'submit',
                        'name'  => 'process',
                        'value' => $this->getText('PROCESS_GO'),
                    ))
                    ->fetch();
    ?>
</div>
</div>
